ClassicEditor
  .create(document.querySelector('.editor'), {
    toolbar: {
      items: [
        "heading",
        "alignment",
        "|",
        "undo",
        "redo",
        "|",
        "bold",
        "italic",
        "link",
        "imageInsert",
        "imageUpload",
        // "imageInsert",
        'uploadVideo',
        'mediaEmbed',
        "|",
        "insertTable",
        "|",
        "findAndReplace",
        "selectAll",
        "horizontalLine",
      ],
    },
    language: "en",
    mediaEmbed: {
      extraProviders: {
        name: 'myprovider',
        // url: /^https?:\/\/.*?\.mp4$/, 
        url: /^.*\.mp4$/,
        html: match => {
          const src = match['input'];
          return (
            `<video width="100%"  controls>
              <source src="${src}"  type="video/mp4">
                您的浏览器不支持 HTML5 video 标签。
            </video>`
          );
        }
      }
    },
    uploadVideo: {
      uploadFun: file => new Promise((resolve, rej) => {
          resolve('https://kt.sh-t.com.cn/e_4/video/1fa3e1f24a42259d55cb39ff4c516bd9.mp4')
      }),
    },
  })
  .then(editor => {
    window.editor = editor;
  })
  .catch(handleSampleError);

function handleSampleError(error) {
  const issueUrl = 'https://github.com/ckeditor/ckeditor5/issues';

  const message = [
    'Oops, something went wrong!',
    `Please, report the following error on ${ issueUrl } with the build id "laemiiip1kkp-rdi826da4i4z" and the error stack trace:`
  ].join('\n');

  console.error(message);
  console.error(error);
}